package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.RotationMapper;
import com.jsb.model.Rotation;
import com.jsb.model.RotationExample;

@Service
public class RotationService{
	
	@Resource
	private RotationMapper rotationMapper;
	
	public void addRotation(Rotation rotation) {
		rotationMapper.insertSelective(rotation);
	}
	
	public void delRotationByUuid(String uuid) {
		rotationMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateRotation(Rotation rotation) {
		rotationMapper.updateByPrimaryKeySelective(rotation);
	}
	
	public void updateRotationByExample(Rotation rotation,RotationExample rotationExample){
	    rotationMapper.updateByExampleSelective(rotation,rotationExample);
	}
	
	public Rotation getRotationByUuid(String uuid) {
		return rotationMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Rotation> getPageRotation(RotationExample rotationExample) {
		return rotationMapper.selectPage(rotationExample);
	}
	
	public int countRotation(RotationExample rotationExample) {
		return rotationMapper.countByExample(rotationExample);
	}
	
	public List<Rotation> selectByExample(RotationExample example){
	    return rotationMapper.selectByExample(example);
	}
}
